package com.example.xzs.admin.userlogin.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class UserRegistration implements Serializable {
     @ApiModelProperty(value = "用户名")
     @Pattern(regexp = "^.{1,20}$", message = "用户名称已超出20个字符")
     @NotBlank(message = "用户名不能为空")
     private String username;

     @ApiModelProperty(value = "用户名",required = true)
     @Pattern(regexp = "^.{8,16}$", message = "密码必须由8~20个字符组成")
     @NotBlank(message = "密码不能为空")
     private String password;

     @ApiModelProperty(value = "班级")
     @NotNull(message = "班级不能为空")
     private Integer gradeId;

}
